package com.du.web.sample.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.du.web.sample.model.learn.LearnTaskData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Desc :
 * @Author: shuangdu
 * @date : 2022/4/7
 */
@Mapper
public interface LearnTaskMapper extends BaseMapper<LearnTaskData> {

    @Select("SELECT COUNT(1) FROM learn_record WHERE user_id = #{userId} AND FIND_IN_SET(#{schoolId}, school_ids)")
    int hasData(String userId, String schoolId);

}
